<template>
  <view>
    <block>
      <view class="navScroll_con">
        <view class="navScroll"
              ref="nav">
          <view>
            <text @tap="navClick(item)"
                  :class="active == item.blockId?'active':''"
                  v-for="(item, index) in articleBlockList"
                  :key="index">{{item.blockName}}</text>
          </view>
        </view>
      </view>
    </block>
  </view>
</template>

<script>
export default {
  data() {
    return {
      active: 1
    }
  },

  components: {},
  props: {
    articleBlockList: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    navClick(item) {
      this.active = item.blockId
      this.$emit('navClick', {
        nav: item
      })
    }
  }
}
</script>
<style>
@import './y-nav-scroll.css';
</style>